<?php $this -> load -> view('adminx/header'); ?>
<!-- BEGIN CONTAINER -->
<div class="page-container">
	<!-- BEGIN SIDEBAR -->
	<?php $this -> load -> view('adminx/mune'); ?>
	<!-- END SIDEBAR -->
	<!-- BEGIN CONTENT -->
	<div class="page-content-wrapper">
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- /.modal -->
			<h3 class="page-title"> <?php echo $title; ?> <small><?php echo $en; ?></small></h3>
			<div class="page-bar">
				<ul class="page-breadcrumb">
					<li>
						<i class="fa fa-home"></i>
						<a href="/adminx">首页</a>
						<i class="fa fa-angle-right"></i>
					</li>
					<li>
						<a href="#"><?php echo $title; ?></a>
					</li>
				</ul>
			</div>
			<!-- END PAGE HEADER-->
			<div class="clearfix"></div>
			<div class="row">
				<div class="col-md-12 col-sm-12">
					<!-- BEGIN REGIONAL STATS PORTLET-->
					<div class="note note-success">
						<p>管理员等级说明：</p>
						<p>1，普通管理员，总部管理全部订单，商品，客服等；</p>
						<p>2，高级管理员有全部的权限；</p>
						<p>3，机构管理员，只能管理自己所在机构的订单和商品；</p>
						<p><br /></p>
						<p>其他注意事项：</p>
						<p>1，机构所在的经纬度，可以通过填写的机构地址自动生成；</p>
						<p>2，经纬度的作用是定位附近的机构（或者店铺）；</p>
						<p>3，机构二维码是用来添加该机构的前台客服管理员的；</p>
						<p>4，机构的前台客服管理员的作用是：会员到店提货时，可以用该管理员的手机微信扫描会员的提货二维码，完成提货操作；</p>
					</div>
					<div class="portlet light ">
						<div class="portlet-title">
							<div class="caption">
								<i class="icon-share font-red-sunglo"></i>
								<span class="caption-subject font-red-sunglo bold uppercase">管理员管理</span>
							</div>
							<div class="actions">
								<a class="btn btn-circle btn-icon-only blue" href="javascript:;" onclick="alert_ts('<?php echo $this -> config -> item('xt_ts'); ?>')"> <i class=" icon-bulb"></i> </a>
								<a class="btn btn-circle btn-icon-only green refresh" href="javascript:;" > <i class="icon-refresh"></i> </a>
								<a class="btn btn-circle btn-icon-only red" href="javascript:;"><i class="icon-trash"></i></a>
								<a class="btn btn-circle btn-icon-only btn-default fullscreen" href="javascript:;"> </a>
							</div>
						</div>
						<div class="portlet-body">
							<div class="btn-toolbar margin-bottom-10">
								<form class="btn-toolbar" id="get_tbody" onkeydown="if(event.keyCode==13)return false;">
									<div class="portlet-input input-inline" style="margin-left: 10px;width: 150px;">
										<div class="input-icon right">
											<i class="icon-magnifier"></i>
											<input id="key" name="key" type="text" class="form-control" placeholder="search...">
										</div>
									</div>
									<div class="portlet-input input-inline">
										<select  id="page" name="page" class="form-control input-circle" style="width: 100px;">
											<option>1</option>
										</select>
									</div>
									<div class="portlet-input input-inline">
										<select  id="state" name="state" class="form-control input-circle" style="width: 100px;">
											<option value="0">全部</option>
											<option value="1">普通管理员</option>
											<option value="2">高级管理员</option>
											<option value="3">机构管理员</option>
											<option value="4">等待审核</option>
										</select>
									</div>
									<a class="btn purple" onclick="show_add()" href="javascript:;"><i class="fa  fa-pencil"></i> 添加管理员</a>
								</form>
							</div>
							<div class=""></div>
							<div class="table-scrollable table-scrollable-borderless">
								<table class="table table-hover table-light">
									<thead>
										<tr>
											<th>#</th>
											<th>头像</th>
											<th>个人信息</th>
											<th>机构信息</th>
											<th width="290">操作</th>
										</tr>
									</thead>
									<tbody id="tbody">
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<!-- END REGIONAL STATS PORTLET-->
				</div>
			</div>
		</div>
	</div>
	
	

<div class="modal fade" id="show_add">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title">添加管理员</h4>
			</div>
			<form role="form" id="addx" enctype="multipart/form-data">
			<div class="modal-body">
					<div class="form-group fl_name">
						<input class="form-control required" name="name" placeholder="姓名"/>
					</div>
					<div class="form-group">
						<label>MID</label>
						<input class="form-control required number" name="mid" placeholder="MID"/>
					</div>
					<div class="form-group">
						<label>手机</label>
						<input class="form-control required phone" name="phone" placeholder="手机"/>
					</div>
					<div class="form-group">
						<label>密码</label>
						<input type="password" class="form-control required" name="password" placeholder="密码"/>
					</div>
					<div class="form-group">
						<label>等级</label>
						<select class="form-control" name="state">
							<option value="1">普通管理员</option>
							<option value="2">高级管理员</option>
							<option value="3">机构管理员</option>
							<option value="4">等待审核</option>
						</select>
					</div>
					<div class="form-group">
						<label>状态</label>
						<select class="form-control" name="type">
							<option value="1">允许登录</option>
							<option value="2">临时强迫退出</option>
							<option value="3">禁用</option>
						</select>
					</div>
					<hr />
					<div class="form-group">
						<label>机构名称</label>
						<input class="form-control" name="jg_name" placeholder="机构名称"/>
					</div>
					<div class="form-group">
						<label>经营类别</label>
						<select class="form-control" name="jg_jy">
							<?php
							$q=$this->db->get_where('fl',array('sf'=>6));
							foreach($q->result_array() as $v){
							?>
							<option value="<?php echo $v['fl_id']; ?>"><?php echo $v['name']; ?></option>
							<?php } ?>
						</select>
					</div>
					<div class="form-group">
						<label>机构排序</label>
						<input class="form-control" name="jg_sort" placeholder="机构排序"/>
					</div>
					<div class="form-group">
						<label>机构LOGO</label>
						<?php echo $this -> form -> doform('pic', 'jg_pic', '', ''); ?>
					</div>
					<div class="form-group">
						<label>机构区域</label>
						<input class="form-control" name="jg_qy" placeholder="机构地址"/>
					</div>
					<div class="form-group">
						<label>机构地址</label>
						<input class="form-control" name="jg_dz" placeholder="机构地址"/>
					</div>
					<div class="form-group">
						<label>经纬度</label>
						<div class="input-group">
                                <input type="text" class="form-control" name="jg_jd" placeholder="纬度" style="width: 50%;">
                                <input type="text" class="form-control" name="jg_wd" placeholder="经度" style="width: 50%;">
                         </div>
					</div>
					<div class="form-group">
						<label>机构联系方式</label>
						<input class="form-control" name="jg_phone" placeholder="机构联系方式"/>
					</div>
					<div class="form-group">
						<label>店招</label>
						<input class="form-control" name="jg_dianzhao" placeholder="店招"/>
					</div>
					<div class="form-group">
						<label>是否显示</label>
						<select class="form-control" name="is_xs">
							<option value="1">显示</option>
							<option value="2">不显示</option>
						</select>
					</div>
					<div class="form-group">
						<textarea class="form-control" style="height: 100px;" name="note" placeholder="简介"></textarea>
					</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn" data-dismiss="modal">
					<i class="fa fa-compress"></i> 
					关 闭
				</button>
				<button type="submit" class="btn blue" >
					<i class="fa fa-send"></i> 
					添加
				</button>
			</div>
			</form>
		</div>
	</div>
</div>

<div class="modal fade" id="show_up">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title">修改管理员信息</h4>
			</div>
			<form role="form" id="upx" enctype="multipart/form-data">
			<div class="modal-body">
					<div class="form-group fl_name">
						<input class="form-control required" name="name" placeholder="姓名"/>
					</div>
					<div class="form-group">
						<label>MID</label>
						<input class="form-control required number" name="mid" placeholder="MID"/>
					</div>
					<div class="form-group">
						<label>手机</label>
						<input class="form-control" name="phone" placeholder="手机"/>
					</div>
					<div class="form-group">
						<label>密码</label>
						<input id="password" type="password" class="form-control required" name="password" placeholder="密码"/>
					</div>
					<div class="form-group">
						<label>等级</label>
						<select class="form-control" name="state">
							<option value="1">普通管理员</option>
							<option value="2">高级管理员</option>
							<option value="3">机构管理员</option>
							<option value="4">等待审核</option>
						</select>
					</div>
					<div class="form-group">
						<label>状态</label>
						<select class="form-control" name="type">
							<option value="1">允许登录</option>
							<option value="2">临时强迫退出</option>
							<option value="3">禁用</option>
						</select>
					</div>
					<hr />
					<div class="form-group">
						<label>机构名称</label>
						<input class="form-control" name="jg_name" placeholder="机构名称"/>
					</div>
					<div class="form-group">
						<label>经营类别</label>
						<select class="form-control" name="jg_jy">
							<?php
							$q=$this->db->get_where('fl',array('sf'=>6));
							foreach($q->result_array() as $v){
							?>
							<option value="<?php echo $v['fl_id']; ?>"><?php echo $v['name']; ?></option>
							<?php } ?>
						</select>
					</div>
					<div class="form-group">
						<label>机构排序</label>
						<input class="form-control" name="jg_sort" placeholder="机构排序"/>
					</div>
					<div class="form-group">
						<label>机构背景图片</label>
						<?php echo $this -> form -> doform('pic', 'jg_pic', '', ''); ?>
					</div>
					<div class="form-group">
						<label>机构区域</label>
						<input class="form-control" name="jg_qy" placeholder="机构地址"/>
					</div>
					<div class="form-group">
						<label>机构地址</label>
						<input class="form-control" name="jg_dz" placeholder="机构地址"/>
					</div>
					<div class="form-group">
						<label>经纬度</label>
						<div class="input-group">
                                <input type="text" class="form-control" name="jg_jd" placeholder="纬度" style="width: 50%;">
                                <input type="text" class="form-control" name="jg_wd" placeholder="经度" style="width: 50%;">
                         </div>
					</div>
					<div class="form-group">
						<label>机构联系方式</label>
						<input class="form-control" name="jg_phone" placeholder="机构联系方式"/>
					</div>
					<div class="form-group">
						<label>店招</label>
						<input class="form-control" name="jg_dianzhao" placeholder="店招"/>
					</div>
					<div class="form-group">
						<label>是否显示</label>
						<select class="form-control" name="is_xs">
							<option value="1">显示</option>
							<option value="2">不显示</option>
						</select>
					</div>
					<div class="form-group">
						<input name="idx" id="upidx" value="0" type="hidden" />
						<textarea class="form-control" style="height: 100px;" name="note" placeholder="简介"></textarea>
					</div>
				
			</div>
			<div class="modal-footer">
				<button type="button" class="btn" data-dismiss="modal">
					<i class="fa fa-compress"></i> 
					关 闭
				</button>
				<button type="submit" class="btn blue">
					<i class="fa fa-send"></i> 
					修改
				</button>
			</div>
			</form>
		</div>
	</div>
</div>


<div class="modal fade" id="ewm">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
					&times;
				</button>
				<h4 class="modal-title" id="fl_title"><span id="ewm_title"></span>永久二维码</h4>
			</div>
			<div class="modal-body">
				<img style="width: 100%;" id="ewm_img" src="" class="img-responsive" />
			</div>
			<div class="modal-footer">
				<button type="button" class="btn blue" data-dismiss="modal">
					<i class="fa fa-send"></i>
					好的
				</button>
			</div>
		</div>
	</div>
</div>

	<!-- BEGIN QUICK SIDEBAR -->
	<?php $this -> load -> view('adminx/lt'); ?>
	<!-- END QUICK SIDEBAR -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php $this -> load -> view('adminx/footer'); ?>
<script>
    var _model='staff';
</script>
<script src="/mex/global/plugins/ajaxfileupload.js"></script>
<script src="/mex/lance/domodel.js"></script>